cli/refs: Port to C99 style
authorColin Walters <walters@verbum.org>
Tue, 14 Jun 2022 13:50:07 +0000 (09:50 -0400)
committerColin Walters <walters@verbum.org>
Wed, 15 Jun 2022 13:36:54 +0000 (09:36 -0400)
General background cleanup.

src/ostree/ot-remote-builtin-refs.c

index d778fe6027a0bce10750afadb40cda94b51da21d..29c39328b1682c00925aaf0e7a85f3b0b19c7c34 100644 (file)
@@ -39,34 +39,30 @@ static GOptionEntry option_entries[] = {
 gboolean
 ot_remote_builtin_refs (int argc, char **argv, OstreeCommandInvocation *invocation, GCancellable *cancellable, GError **error)
 {
-  g_autoptr(GOptionContext) context = NULL;
-  g_autoptr(OstreeRepo) repo = NULL;
-  const char *remote_name;
-  gboolean ret = FALSE;
-  g_autoptr(GHashTable) refs = NULL;
-
-  context = g_option_context_new ("NAME");
+  g_autoptr(GOptionContext) context = g_option_context_new ("NAME");
 
+  g_autoptr(OstreeRepo) repo = NULL;
   if (!ostree_option_context_parse (context, option_entries, &argc, &argv,
                                     invocation, &repo, cancellable, error))
-    goto out;
+    return FALSE;
 
   if (argc < 2)
     {
       ot_util_usage_error (context, "NAME must be specified", error);
-      goto out;
+      return FALSE;
     }
 
   if (opt_cache_dir)
     {
       if (!ostree_repo_set_cache_dir (repo, AT_FDCWD, opt_cache_dir, cancellable, error))
-        goto out;
+        return FALSE;
     }
 
-  remote_name = argv[1];
+  const char *remote_name = argv[1];
+  g_autoptr(GHashTable) refs = NULL;
 
   if (!ostree_repo_remote_list_refs (repo, remote_name, &refs, cancellable, error))
-    goto out;
+    return FALSE;
   else
     {
       g_autoptr(GList) ordered_keys = NULL;
@@ -81,7 +77,5 @@ ot_remote_builtin_refs (int argc, char **argv, OstreeCommandInvocation *invocati
         }
     }
 
-  ret = TRUE;
-out:
-  return ret;
+  return TRUE;
 }